﻿using System.Text;

namespace UwaySoft.EsheetServer.Help.Template
{
    /// <summary>
    /// 派单信息
    /// </summary>
    public class NewSheetItemEntity : BaseTemplate
    {
        #region 成员字段

        private string _targetSpace;
        private string _acceptNode;
        private string _acceptSuggest;
        private string _acceptGroup;
        private string _acceptor;
        private string _acceptTime;

        #endregion

        #region 属 性

        /// <summary>
        /// 派单信息
        /// </summary>
        public string TargetSpace
        {
            get
            {
                CheckString(_targetSpace, "缺失派单信息");
                return _targetSpace;
            }
            set
            {
                _targetSpace = value;
            }
        }
        /// <summary>
        /// 处理节点
        /// </summary>
        public string AcceptNode
        {
            get
            {
                CheckString(_acceptNode, "缺失处理节点");
                return _acceptNode;
            }
            set
            {
                _acceptNode = value;
            }
        }
        /// <summary>
        /// 处理意见
        /// </summary>
        public string AcceptSuggest
        {
            get
            {
                if (!string.IsNullOrEmpty(_targetSpace))
                {
                    return FilterHtml(_acceptSuggest);
                }
                return string.Empty;
            }
            set
            {
                _acceptSuggest = value;
            }
        }
        /// <summary>
        /// 处理技能组
        /// </summary>
        public string AcceptGroup
        {
            get { return _acceptGroup; }
            set { _acceptGroup = value; }
        }
        /// <summary>
        /// 处理人
        /// </summary>
        public string Acceptor
        {
            get { return _acceptor; }
            set { _acceptor = value; }
        }
        /// <summary>
        /// 处理时间
        /// </summary>
        public string AcceptTime
        {
            get { return _acceptTime; }
            set { _acceptTime = value; }
        }

        #endregion

        /// <summary>
        /// 重写ToString
        /// </summary>
        /// <returns>返回标记形式字符窜</returns>
        public override string ToString()
        {
            var bldr = new StringBuilder();
            bldr.AppendFormat("<targetSpace chinaName=\"派单信息\">{0}</targetSpace>", TargetSpace);
            bldr.AppendFormat("<acceptNode chinaName=\"处理节点\">{0}</acceptNode>", AcceptNode);
            bldr.AppendFormat("<acceptGroup chinaName=\"处理技能组\">{0}</acceptGroup>", AcceptGroup);
            bldr.AppendFormat("<acceptor chinaName=\"处理人\">{0}</acceptor>", Acceptor);
            bldr.AppendFormat("<acceptTime chinaName=\"处理时间\">{0}</acceptTime>", AcceptTime);
            bldr.AppendFormat("<acceptSuggest chinaName=\"处理意见\">{0}</acceptSuggest>", AcceptSuggest);
            return bldr.ToString();
        }
    }
}
